package cn.anquing.demo.mybatisplus.component.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class DemoEventListener implements ApplicationListener<DemoEvent> {

    private static final Logger LOGGER = LoggerFactory.getLogger(DemoEventListener.class);

    @Override
    public void onApplicationEvent(DemoEvent demoEvent) {
        try {
            LOGGER.error("=============开始==========");
            Object source = demoEvent.getSource();
            String name = demoEvent.getName();
            // 业务

            LOGGER.error("=============更新成功==========");
        } catch (Exception var4) {
            LOGGER.error("=============更新失败==========");
            var4.printStackTrace();
        }
    }
}